﻿﻿<template>
    <el-card class="form-container">
        <el-form :model="dataForm" ref="dataForm" :rules="dataRule"  @keyup.enter.native="dataFormSubmitHandle()" label-width="90px">
                                                                            <el-form-item label="支付类型 1.支付宝 2.微信 3.银联 4.钱包 5.混合" prop="payType">
                        <el-input v-model="dataForm.payType" placeholder="请输入支付类型 1.支付宝 2.微信 3.银联 4.钱包 5.混合"></el-input>
                    </el-form-item>
                                                                <el-form-item label="订单编号" prop="orderCode">
                        <el-input v-model="dataForm.orderCode" placeholder="请输入订单编号"></el-input>
                    </el-form-item>
                                                                <el-form-item label="订单总额" prop="orderPrice">
                        <el-input v-model="dataForm.orderPrice" placeholder="请输入订单总额"></el-input>
                    </el-form-item>
                                                                <el-form-item label="实际支付金额" prop="payPrice">
                        <el-input v-model="dataForm.payPrice" placeholder="请输入实际支付金额"></el-input>
                    </el-form-item>
                                                                <el-form-item label="订单类型 " prop="orderType">
                        <el-input v-model="dataForm.orderType" placeholder="请输入订单类型 "></el-input>
                    </el-form-item>
                                                                <el-form-item label="支付详情:存储第三方支付渠道返回数据信息" prop="payDetail">
                        <el-input v-model="dataForm.payDetail" placeholder="请输入支付详情:存储第三方支付渠道返回数据信息"></el-input>
                    </el-form-item>
                                                                <el-form-item label="支付回调订单号:冗余字段" prop="returnPayNo">
                        <el-input v-model="dataForm.returnPayNo" placeholder="请输入支付回调订单号:冗余字段"></el-input>
                    </el-form-item>
                                                                <el-form-item label="支付记录状态1.待支付 2.支付中 3.支付成功 4.订单作废" prop="serialStatus">
                        <el-input v-model="dataForm.serialStatus" placeholder="请输入支付记录状态1.待支付 2.支付中 3.支付成功 4.订单作废"></el-input>
                    </el-form-item>
                                                                <el-form-item label="创建时间" prop="createTime">
                        <el-input v-model="dataForm.createTime" placeholder="请输入创建时间"></el-input>
                    </el-form-item>
                                                                <el-form-item label="修改时间" prop="updateTime">
                        <el-input v-model="dataForm.updateTime" placeholder="请输入修改时间"></el-input>
                    </el-form-item>
                                        <el-form-item>
                <el-button @click="cancel">取消</el-button>
                <el-button type="primary"  @click="submit('dataForm')">确定</el-button>
            </el-form-item>
        </el-form>
    </el-card>
</template>

<script>
    import {createOrderPaySerial} from '@/api/admin/orderPaySerial'
    export default{
        name: 'add-orderPaySerial',
        data(){
            return {
                dataForm: {
                                                                                                                    payType : ''
                                                                                                orderCode : ''
                                                                                                orderPrice : ''
                                                                                                payPrice : ''
                                                                                                orderType : ''
                                                                                                payDetail : ''
                                                                                                returnPayNo : ''
                                                                                                serialStatus : ''
                                                                                                createTime : ''
                                                                                                updateTime : ''
                                                            },
                dataRule: {
                                                                                                                    payType: [
                            {
                                required: true,
                                message: '请输入支付类型 1.支付宝 2.微信 3.银联 4.钱包 5.混合',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                orderCode: [
                            {
                                required: true,
                                message: '请输入订单编号',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                orderPrice: [
                            {
                                required: true,
                                message: '请输入订单总额',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                payPrice: [
                            {
                                required: true,
                                message: '请输入实际支付金额',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                orderType: [
                            {
                                required: true,
                                message: '请输入订单类型 ',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                payDetail: [
                            {
                                required: true,
                                message: '请输入支付详情:存储第三方支付渠道返回数据信息',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                returnPayNo: [
                            {
                                required: true,
                                message: '请输入支付回调订单号:冗余字段',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                serialStatus: [
                            {
                                required: true,
                                message: '请输入支付记录状态1.待支付 2.支付中 3.支付成功 4.订单作废',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                createTime: [
                            {
                                required: true,
                                message: '请输入创建时间',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                                                                updateTime: [
                            {
                                required: true,
                                message: '请输入修改时间',
                                trigger: 'blur'
                            },
                            {
                                min: 3,
                                max: 20,
                                message: '长度在 3 到 20 个字符',
                                trigger: 'blur'
                            }
                        ]
                                                            }
            }
        },
        methods:{
            cancel(){
                this.$router.go(-1)
            },
            submit(){
                const set = this.$refs;
                set['dataForm'].validate((valid) => {
                    if (!valid) {
                        return false
                    }
                    createOrderPaySerial(this.dataForm).then(() => {
                        this.$notify({
                            title: '添加成功',
                            message: '添加成功',
                            type: 'success',
                            duration: 2000,
                            onClose: this.$router.go(-1)
                        })
                    })
                })
            }
        }
    }
</script>

<style>
</style>
